/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: GaoBo
 * Date: 2021-03-30
 * Time: 19:11
 */
class A {

}
public class TestDemo {

    public static void main(String[] args) {
        String str = "10a";
        /*int a = Integer.valueOf(str);
        System.out.println(a);*/

        int b = Integer.parseInt(str);
        System.out.println(b);
    }

    /**
     * 整数转换为字符串
     * @param args
     */
    public static void main16(String[] args) {
        int a = 10;
        String str = a + "";
        System.out.println(str);

        String ret = String.valueOf(a);
        System.out.println(ret);
    }

    public static void main15(String[] args) {
        int a = 1;
        //boolean b = a;//这是两个完全不一样的类型，不要进行相互赋值

        boolean f = true;
        //int c = f;
    }

    public static void main14(String[] args) {
        int a = 10;
        a = 20;
        System.out.println(a);

        final int b;
        b = 30;
        //b = 40;
        System.out.println(b);
    }

    public static void main13(String[] args) {
        int maxNum = 10;
        int a_1 = 10;
        int a_2 = 20;
        int a$_5 = 90;//不建议  《阿里巴巴规约手册》
        int _______ = 10;
        int __________________ = 9999;
        System.out.println(__________________);
        int a = 10;
        int _a = 10;
    }

    public static void main12(String[] args) {
        {
            int a = 90;//此时的a和最外层的a是不是同一个
            //当前这个a 只在当前的括号里面是有效的！！！
        }
        //a = 10;
    }


    public static void main11(String[] args) {
        int a = 10;//整个函数内
        {
             a = 90;//此时的a和最外层的a是同一个
        }
    }

    public static void main10(String[] args) {
        String str = "result = ";
        int a = 10;
        int b = 20;
        String result = str + a + b;
        System.out.println(result);
    }


    public static void main9(String[] args) {
        String str1 = "abc";
        String str2 = "def";
        String str3 = str1+str2;
        System.out.println(str3);
        System.out.println("abc"+"def");
        int a = 10;
        int b = 20;
        System.out.println("a: "+a + " b: "+b);

    }


    public static void main8(String[] args) {
        String str = "gaobo";
        System.out.println(str);//str.sout 回车
        //char *p = "abcde";
        String str2 = "My name is \"张三\"";
        System.out.println(str2);
    }

    public static void main7(String[] args) {
        short s = 12;//2
        System.out.println(s);

        boolean flg1 = true;
        boolean flg2 = false;
        //boolean flg3 = 1;
        //boolean flg4 = 0;
    }

    public static void main6(String[] args) {
        int a = 10;
        long b = 20;
        //int c = a+b;//也会进行类型提升，先将a提升为long
    }

    public static void main5(String[] args) {
        byte b1 = 10;
        byte b2 = 20;
        int b3 = b1+b2;

        //byte b5 = b1+1;

        System.out.println(b3);

        byte b4 = 10+20;
        System.out.println(b4);

    }

    public static void main4(String[] args) {
        //1  对标的就是C语言当中的char类型
        //8   -2^7  2^7 -1    取值范围： -128 - 127
        byte b = 10;
       // byte b2 = 128;//赋值的时候，不能够给当前类型所表示的范围外的数字
        //byte b1 = b+1; 稍后说
        int i = 2147483647;
        System.out.println(i);
    }

    public static void main3(String[] args) {
        char ch = 'a';
        System.out.println(ch);
        char ch2 = '高';
        System.out.println(ch2);
        char ch3 = 97;
        System.out.println(ch3);
        //char ch4 = -10;//在Java当中  字符类型是不可以给负数的
        //System.out.println(ch4);
    }

    public static void main2(String[] args) {
        /*float f = 12.5f;//4  在Java当中 12.5 默认是double类型  更安全
        System.out.println(f);
        int a = 10;
        */
        String str = "123";
        int a = Integer.valueOf(str);
        System.out.println(a);

    }
    public static void main1(String[] args) {
        System.out.println("hello world");

        double d = 12.5;//8
        System.out.println(d);

        int a = 1;
        int b = 2;
        System.out.println(a/b);

        double c = 1.1;
        double f = 1.1;
        System.out.println(c*f);
    }
}
